﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Data.SqlClient;
using Microsoft.VisualBasic;

namespace SalePartial.Model
{

    public class XPInquiryFilterInfo
    {
        // Methods
        public XPInquiryFilterInfo()
        {
            this._InquiryFilterID = Guid.NewGuid();
            this._CompanyID = Guid.Empty;
            this._FilterName = string.Empty;
            this._CreateDate = DateTime.Now;
            this._UpdateDate = DateTime.Now;
            this._FilterExpression = string.Empty;
            this._FilterExpression2 = string.Empty;
            this._XPAllCnt = 0;
            this._XPNewCnt = 0;
        }

        public XPInquiryFilterInfo(SqlDataReader reader)
        {
            this._InquiryFilterID = new Guid();
            this._CompanyID = Guid.Empty;
            this._FilterName = string.Empty;
            this._CreateDate = DateTime.Now;
            this._UpdateDate = DateTime.Now;
            this._FilterExpression = string.Empty;
            this._FilterExpression2 = string.Empty;
            this._XPAllCnt = 0;
            this._XPNewCnt = 0;
            this.LoadFromReader(reader);
        }

        protected void LoadFromReader(SqlDataReader reader)
        {
            if ((!Information.IsNothing(reader) && !reader.IsClosed))
            {
                this._InquiryFilterID = reader.GetGuid(0);
                this._CompanyID = reader.GetGuid(1);
                this._FilterName = reader.GetString(2);
                if (!reader.IsDBNull(3))
                {
                    this._CreateDate = reader.GetDateTime(3);
                }
                if (!reader.IsDBNull(4))
                {
                    this._CreateDate = reader.GetDateTime(4);
                }
                this._FilterExpression = reader.GetString(5);
                if (!reader.IsDBNull(6))
                {
                    this._FilterExpression2 = reader.GetString(6);
                }
                if (!reader.IsDBNull(7))
                {
                    this._XPAllCnt = reader.GetInt32(7);
                }
                if (!reader.IsDBNull(8))
                {
                    this._XPNewCnt = reader.GetInt32(8);
                }
                
            }
        }

        // Properties
        public Guid InquiryFilterID
        {
            get { return this._InquiryFilterID ; }
            set { this._InquiryFilterID = value; }
        }

        public Guid CompanyID
        {
            get { return this._CompanyID; }
            set { this._CompanyID = value; }
        }

        public string FilterName
        {
            get { return this._FilterName; }
            set { this._FilterName = value; }
        }

        public DateTime CreateDate
        {
            get { return this._CreateDate; }
            set { this._CreateDate = value; }
        }

        public DateTime UpdateDate
        {
            get { return this._UpdateDate; }
            set { this._UpdateDate = value; }
        }

        public string FilterExpression
        {
            get { return this._FilterExpression; }
            set { this._FilterExpression = value; }
        }

        public string FilterExpression2
        {
            get { return this._FilterExpression2; }
            set { this._FilterExpression2 = value; }
        }

        public int XPAllCnt
        {
            get { return this._XPAllCnt; }
            set { this._XPAllCnt = value; }
        }

        public int XPNewCnt
        {
            get { return this._XPNewCnt; }
            set { this._XPNewCnt = value; }
        }


        // Fields
        private Guid _InquiryFilterID;
        private Guid _CompanyID;
        private string _FilterName;
        private DateTime _CreateDate;
        private DateTime _UpdateDate;
        private string _FilterExpression;
        private string _FilterExpression2;
        private int _XPAllCnt;
        private int _XPNewCnt;
    }


}
